You are here: Symbol Reference > Dew Namespace > Dew.Stats Namespace > Dew.Stats.Units Namespace > Classes > StatControlCharts Class > StatControlCharts Methods > EWMAChart Method > StatControlCharts.EWMAChart Method ([In] TMtx, [In] TVec, out double, TVec, TVec, double, double)
Dew Stats for .NET
ContentsIndexHome
PreviousUpNext
StatControlCharts.EWMAChart Method ([In] TMtx, [In] TVec, out double, TVec, TVec, double, double)

Calculates the Exponential Weighted Moving Average (EWMA) control chart.

Syntax
C#
Visual Basic
public static void EWMAChart([In] TMtx Data, [In] TVec DrawVec, out double CL, TVec UCL, TVec LCL, double r, double Confidence);
Parameters 
Description 
[In] TMtx Data 
Data of grouped responses. Each row contais a response at specific time. It's asumed the rows are in time order. 
[In] TVec DrawVec 
Returns the calculated EWMA chart points. 
out double CL 
Returns EWMA chart center line. 
TVec UCL 
Returns EWMA chart upper control limits. In this case UCL and LCL are constant (asymptote) limits. 
TVec LCL 
Returns EWMA chart lower control limits. In this case UCL and LCL are constant (asymptote) limits. 
double r 
Weighting constant that weights past and current information. If, for example, r=0.3, 70% of the weight will be given to past information and 30% to current information. Typically a r between 0.1 and 0.4 provides a reasonable balance between past and current information and 0.2 is very common in actual practice. 
double Confidence 
 

In this case UCL and LCL are not constant, but use an exact formula to calculate control limits for each point. It's worth noting that UCL and LCL values rapidly approach the asymptote value.

The following code will load data from file and create EWMA chart with r=0.25 and significance 95%:

using Dew.Math; using Dew.Math.Units; using Dew.Stats.Units; namespace Dew.Examples { private void Example(Steema.TeeChart.Styles.Line Series1, Steema.TeeChart.Styles.Line Series2, Steema.TeeChart.Styles.Line Series3) { Matrix data = new Matrix(0,0); Vector lcl = new Vector(0); Vector ucl = new Vector(0); double cl; data.LoadFromFile("ewma_data.vec"); StatControlCharts.EWMAChart(data,drawvec,out cl,ucl,lcl,0.25,0.95); MtxVecTee.DrawValues(drawvec,Series1,0,1,false); // Series2 and Series3 are used for displaying control limits. MtxVecTee.DrawValues(lcl,Series2,0,1,false); MtxVecTee.DrawValues(ucl,Series3,0,1,false); } }
Copyright (c) 1999-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!